package main


import (
	"fmt"
	. ".."
)

func main (){
	serv,err := NewHTTPServer("127.0.0.1",880,10)
	if err!=nil {
		fmt.Printf("%+v\n",err)
		return
	}
	serv.AddRouter("/hello", func(req *HTTPRequest,resp *HTTPResponse){
		resp.SetCookie("key",&Cookie{
			Value :"valeee",
			Expires:0,
			MaxAge:0,
			Domain:"",
			Path :"/",
			Secure:true,
			HttpOnly:true,
		})
		resp.Write([]byte("Hello!"))
	})
	err = serv.Start()
	if err!=nil {
		fmt.Printf("%+v\n",err)
		return
	}
}
